package com.cloud.api.domain.job;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder;
import lombok.Data;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * @author 杨斌
 * 2024-12-2024-12-10
 */

@Data
@TableName("t_vehicle_data")
@Schema(description = "车辆数据实体类")
@Builder
public class VehicleData implements Serializable {
    @TableField("op_time")
    @Schema(description = "报文时间")
    private String opTime;
    @TableField("dt")
    @Schema(description = "报文时间 年月日")
    private String dt;
    @TableField("vin")
    @Schema(description = "车辆vin")
    private String vin;
    @TableField("receive_time")
    @Schema(description = "服务器接受时间")
    private String receiveTime;
    @TableField("command_type")
    @Schema(description = "命令标识")
    private String commandType;
    @TableField("vehicle_state")
    @Schema(description = "车辆状态")
    private Short vehicleState;
    @TableField("charge_state")
    @Schema(description = "充电状态")
    private Short chargeState;
    @TableField("operational_mode")
    @Schema(description = "运行模式")
    private Short operationalMode;
    @TableField("speed")
    @Schema(description = "车速")
    private Integer speed;
    @TableField("accumulative_mileage")
    @Schema(description = "累计里程")
    private Long accumulativeMileage;
    @TableField("total_voltage")
    @Schema(description = "总电压")
    private Integer totalVoltage;
    @TableField("total_current")
    @Schema(description = "总电流")
    private Integer totalCurrent;
    @TableField("soc")
    @Schema(description = "soc")
    private Short soc;
    @TableField("dc_state")
    @Schema(description = "DC-DC状态")
    private Short dcState;
    @TableField("gear")
    @Schema(description = "挡位")
    private Short gear;
    @TableField("insulation_resistance")
    @Schema(description = "绝缘电阻")
    private Integer insulationResistance;
    @TableField("acceleration_pedal_travel_value")
    @Schema(description = "加速踏板行程值")
    private Short accelerationPedalTravelValue;
    @TableField("brake_pedal_status")
    @Schema(description = "制动踏板状态")
    private Short brakePedalStatus;
    @TableField("drive_motor_count")
    @Schema(description = "驱动电机个数")
    private Short driveMotorCount;
    @TableField("drive_motor_data")
    @Schema(description = "驱动电机")
    private List<DriveMotorData> driveMotorData;
    @TableField("fuelcell_voltage")
    @Schema(description = "燃料电池电压")
    private Integer fuelcellVoltage;
    @TableField("fuelcell_current")
    @Schema(description = "燃料电池电流")
    private Integer fuelcellCurrent;
    @TableField("fuel_consumption")
    @Schema(description = "燃料消耗率")
    private Integer fuelConsumption;
    @TableField("temperature_probe_count")
    @Schema(description = "燃料电池温度探针总数")
    private Integer temperatureProbeCount;
    @TableField("probe_temperature")
    @Schema(description = "探针温度值集合")
    private List<Short> probeTemperature;
    @TableField("hydrogen_system_max_temperature")
    @Schema(description = "氢系统中最高温度")
    private Integer hydrogenSystemMaxTemperature;
    @TableField("hydrogen_system_max_temperature_probe_num")
    @Schema(description = "氢系统中最高温度探针代号")
    private Short hydrogenSystemMaxTemperatureProbeNum;
    @TableField("hydrogen_system_max_concentration")
    @Schema(description = "氢气最高浓度")
    private Integer hydrogenSystemMaxConcentration;
    @TableField("hydrogen_system_max_concentration_probe_num")
    @Schema(description = "氢气最高浓度传感器代号")
    private Short hydrogenSystemMaxConcentrationProbeNum;
    @TableField("hydrogen_system_max_pressure")
    @Schema(description = "氢气最高压力")
    private Integer hydrogenSystemMaxPressure;
    @TableField("hydrogen_system_max_pressure_probe_num")
    @Schema(description = "氢气最高压力传感器代号")
    private Short hydrogenSystemMaxPressureProbeNum;
    @TableField("fuelcell_dc_status")
    @Schema(description = "高压DC/DC状态")
    private Short fuelcellDcStatus;
    @TableField("engine_status")
    @Schema(description = "发动机状态")
    private Short engineStatus;
    @TableField("engine_crankshaft_speed")
    @Schema(description = "发动机曲轴转速")
    private Integer engineCrankshaftSpeed;
    @TableField("engine_fuel_consumption")
    @Schema(description = "发动机燃料消耗率")
    private Short engineFuelConsumption;
    @TableField("lat")
    @Schema(description = "纬度")
    private Long lat;
    @TableField("latitude_data_type")
    @Schema(description = "纬度类型")
    private String latitudeDataType;
    @TableField("lng")
    @Schema(description = "经度")
    private Long lng;
    @TableField("longitude_data_type")
    @Schema(description = "经度类型")
    private String longitudeDataType;
    @TableField("valid")
    @Schema(description = "是否有效定位,1代表true")
    private Boolean valid;
    @TableField("status")
    @Schema(description = "定位状态")
    private Short status;
    @TableField("max_voltage_system_num")
    @Schema(description = "最高电压电池子系统号")
    private Short maxVoltageSystemNum;
    @TableField("max_voltage_battery_num")
    @Schema(description = "最高电压电池单体代号")
    private Short maxVoltageBatteryNum;
    @TableField("battery_max_voltage")
    @Schema(description = "电池单体电压最高值")
    private Integer batteryMaxVoltage;
    @TableField("min_voltage_system_num")
    @Schema(description = "最低电压电池子系统号")
    private Short minVoltageSystemNum;
    @TableField("min_voltage_battery_num")
    @Schema(description = "最低电压电池单体代号")
    private Short minVoltageBatteryNum;
    @TableField("battery_min_voltage")
    @Schema(description = "电池单体电压最低值")
    private Short batteryMinVoltage;
    @TableField("max_temperature_system_num")
    @Schema(description = "最高温度子系统号")
    private Short maxTemperatureSystemNum;
    @TableField("max_temperature_num")
    @Schema(description = "最高温度探针序号")
    private Short maxTemperatureNum;
    @TableField("max_temperature")
    @Schema(description = "最高温度值")
    private Short maxTemperature;
    @TableField("min_temperature_system_num")
    @Schema(description = "最低温度子系统号")
    private Short minTemperatureSystemNum;
    @TableField("min_temperature_num")
    @Schema(description = "最低温度探针序号")
    private Short minTemperatureNum;
    @TableField("min_temperature")
    @Schema(description = "最低温度值")
    private Short minTemperature;
    @TableField("level")
    @Schema(description = "报警等级")
    private Short level;
    @TableField("alarm_info")
    @Schema(description = "通用报警标志")
    private Long alarmInfo;
    @TableField("temperature_difference")
    @Schema(description = "温度差异报警")
    private Boolean temperatureDifference;
    @TableField("battery_high_temperature")
    @Schema(description = "电池高温报警")
    private Boolean batteryHighTemperature;
    @TableField("device_type_over_voltage")
    @Schema(description = "车载储能装置类型过压报警")
    private Boolean deviceTypeOverVoltage;
    @TableField("device_type_under_voltage")
    @Schema(description = "车载储能装置类型欠压报警")
    private Boolean deviceTypeUnderVoltage;
    @TableField("soc_low")
    @Schema(description = "SOC过低报警")
    private Boolean socLow;
    @TableField("monomer_battery_over_voltage")
    @Schema(description = "单体电池过压报警")
    private Boolean monomerBatteryOverVoltage;
    @TableField("monomer_battery_under_voltage")
    @Schema(description = "单体电池欠压报警")
    private Boolean monomerBatteryUnderVoltage;
    @TableField("soc_high")
    @Schema(description = "SOC过高报警")
    private Boolean socHigh;
    @TableField("soc_jump")
    @Schema(description = "SOC跳变报警")
    private Boolean socJump;
    @TableField("device_type_mis_match")
    @Schema(description = "车载储能装置类型不匹配报警")
    private Boolean deviceTypeMisMatch;
    @TableField("battery_consistency_poor")
    @Schema(description = "单体电池一致性差报警")
    private Boolean batteryConsistencyPoor;
    @TableField("insulation")
    @Schema(description = "绝缘报警")
    private Boolean insulation;
    @TableField("dc_temperature")
    @Schema(description = "DC温度报警")
    private Boolean dcTemperature;
    @TableField("braking_system")
    @Schema(description = "制动系统报警")
    private Boolean brakingSystem;
    @TableField("dc_status")
    @Schema(description = "DC状态报警")
    private Boolean dcStatus;
    @TableField("drive_motor_controller_temperature")
    @Schema(description = "驱动电机控制器温度报警")
    private Boolean driveMotorControllerTemperature;
    @TableField("high_pressure_interlock")
    @Schema(description = "高压互锁状态报警")
    private Boolean highPressureInterlock;
    @TableField("drive_motor_temperature")
    @Schema(description = "驱动电机温度报警")
    private Boolean driveMotorTemperature;
    @TableField("device_type_over_filling")
    @Schema(description = "车载储能装置过充报警")
    private Boolean deviceTypeOverFilling;
    @TableField("device_failure_count")
    @Schema(description = "可储能装置故障总数")
    private Short deviceFailureCount;
    @TableField("device_failure_codes")
    @Schema(description = "可储能装置故障信息列表")
    private List<Long> deviceFailureCodes;
    @TableField("drive_motor_failure_count")
    @Schema(description = "驱动电机故障总数")
    private Short driveMotorFailureCount;
    @TableField("drive_motor_failure_codes")
    @Schema(description = "驱动电机故障信息列表")
    private List<Long> driveMotorFailureCodes;
    @TableField("engine_failure_count")
    @Schema(description = "发动机故障总数")
    private Short engineFailureCount;
    @TableField("engine_failure_codes")
    @Schema(description = "发动机故障信息列表")
    private List<Long> engineFailureCodes;
    @TableField("other_failure")
    @Schema(description = "其他故障总数")
    private Short otherFailure;
    @TableField("other_failure_codes")
    @Schema(description = "其他故障信息列表")
    private List<Long> otherFailureCodes;
    @TableField("subsystem_voltage_count")
    @Schema(description = "可充电储能装置电压子系统个数")
    private Short subsystemVoltageCount;
    @TableField("subsystem_voltage_datas")
    @Schema(description = "可充电储能装置电压数据列表")
    private List<SubSystemVoltageData> subsystemVoltageDatas;
    @TableField("subsystem_temperature_count")
    @Schema(description = "可充电储能装置温度子系统个数")
    private Short subsystemTemperatureCount;
    @TableField("subsystem_temperatures")
    @Schema(description = "可充电储能装置温度数据列表")
    private List<SubSystemTemperature> subsystemTemperatures;
    @TableField("lock_vehicle_state")
    @Schema(description = "锁的状态")
    private Short lockVehicleState;
    @TableField("support_lock")
    @Schema(description = "锁车使能状态0x5A 表示不支持锁车 :0x7E表示支持锁车:0xFF:无效;")
    private Integer supportLock;
    @TableField("command_id")
    @Schema(description = "油车锁车指令,A425384C 锁车")
    private  String commandId;
    @TableField("start_offset")
    @Schema(description = "起始偏移量")
    private Map<String,Integer> startOffset;
    @TableField("record")
    @Schema(description = "车辆报文")
    private String record;
    @TableField("vehicle_type")
    @Schema(description = "车辆类型")
    private String vehicleType;

    // 自定义内容数据长度（数据内容长度 36）
    @TableField("custom_data_length")
    @Schema(description = "自定义内容数据长度（数据内容长度 36）")
    private Short customDataLength;

    // 自定义ST86软件版本
    @TableField("st86_version")
    @Schema(description = "自定义ST86软件版本")
    private Short st86Version;

    // 自定义STM32软件版本(HEX)
    @TableField("stm32_version")
    @Schema(description = "自定义STM32软件版本(HEX)")
    private Short stm32Version;

    // 设备版本号（2字节，仅用作升级使用(ST86低8位，STM32高8位)）
    @TableField("device_version")
    @Schema(description = "设备版本号（2字节，仅用作升级使用(ST86低8位，STM32高8位)）")
    private Integer deviceVersion;

    // 用户代码（用来区分用户类别，详见附录C）
    @TableField("user_code")
    @Schema(description = "用户代码（用来区分用户类别，详见附录C）")
    private Integer userCode;

    // 车型代码（不同客户的车型信息，详见附录C）
    @TableField("vehicle_code")
    @Schema(description = "车型代码（不同客户的车型信息，详见附录C）")
    private Integer vehicleCode;

    // 锁车状态（锁车: 1；未锁车:0；0xFE:锁车故障;0xFF:无效）
    @TableField("lock_status")
    @Schema(description = "锁车状态（锁车: 1；未锁车:0；0xFE:锁车故障;0xFF:无效）")
    private Short lockStatus;

    // Can状态（连接断开: 1；连接正常:0）
    @TableField("can_status")
    @Schema(description = "Can状态（连接断开: 1；连接正常:0）")
    private Short canStatus;

    // 天线状态（故障: 1；正常:0）
    @TableField("antenna_status")
    @Schema(description = "天线状态（故障: 1；正常:0）")
    private Short antennaStatus;

    // 断电状态（断电: 1；正常:0）
    @TableField("power_off_status")
    @Schema(description = "断电状态（断电: 1；正常:0）")
    private Short powerOffStatus;

    // SD卡状态（故障: 1；正常:0）
    @TableField("sd_card_status")
    @Schema(description = "SD卡状态（故障: 1；正常:0）")
    private Short sdCardStatus;

    // 行驶方向（航向角）
    @TableField("driving_direction")
    @Schema(description = "行驶方向（航向角）")
    private Integer drivingDirection;

    // 锁车使能状态（0x5A表示不支持锁车；0x7E表示支持锁车；0xFF：无效）
    @TableField("lock_enable_status")
    @Schema(description = "锁车使能状态（0x5A表示不支持锁车；0x7E表示支持锁车；0xFF：无效）")
    private Short lockEnableStatus;

    // 充电循环次数（1次/位,0xFFFF无效）
    @TableField("charging_cycle_count")
    @Schema(description = "充电循环次数（1次/位,0xFFFF无效）")
    private Integer chargingCycleCount;

    // 累计充电电量（取值范围:0-1000000000，分辨率0.1；0xFFFFFFFF:无效）
    @TableField("accumulated_charging_energy")
    @Schema(description = "累计充电电量（取值范围:0-1000000000，分辨率0.1；0xFFFFFFFF:无效）")
    private Long accumulatedChargingEnergy;

    // 设备累计工作时间（单位s; 分辨率1;范围:0~0xfffffffe; 0xffffffff表示无效）
    @TableField("accumulated_working_time")
    @Schema(description = "设备累计工作时间（单位s; 分辨率1;范围:0~0xfffffffe; 0xffffffff表示无效）")
    private Long accumulatedWorkingTime;

    // 累计gps里程（单位km; 分辨率0.1;范围:0~0xfffffffe; 0xffffffff表示无效）
    @TableField("accumulated_gps_mileage")
    @Schema(description = "累计gps里程（单位km; 分辨率0.1;范围:0~0xfffffffe; 0xffffffff表示无效）")
    private Long accumulatedGpsMileage;

    // 存储器(SD/Flash)总容量（单位:MB; 分辨率1 0xffff表示无效）
    @TableField("total_storage_capacity")
    @Schema(description = "存储器(SD/Flash)总容量（单位:MB; 分辨率1 0xffff表示无效）")
    private Integer totalStorageCapacity;

    // 存储器(SD/Flash)剩余容量（单位:MB; 分辨率1 0xffff表示无效）
    @TableField("remaining_storage_capacity")
    @Schema(description = "存储器(SD/Flash)剩余容量（单位:MB; 分辨率1 0xffff表示无效）")
    private Integer remainingStorageCapacity;

    // GPS信号强度（范围:1~5   (包括5，值越大，信号值越差，其他值表示未知或不可测)
    @TableField("gps_signal_strength")
    @Schema(description = "GPS信号强度（范围:1~5   (包括5，值越大，信号值越差，其他值表示未知或不可测)")
    private Short gpsSignalStrength;

    // GSM信号强度（范围:5~31  （包括31，值越大，信号值越好。其他值，表示未知或不可测）
    @TableField("gsm_signal_strength")
    @Schema(description = "GSM信号强度（范围:5~31  （包括31，值越大，信号值越好。其他值，表示未知或不可测）")
    private Short gsmSignalStrength;
    // 密钥锁车状态（密钥锁车反馈状态：0：解锁；1：锁车中 2：已锁车）
    @TableField("key_lock_status")
    @Schema(description = "密钥锁车状态（密钥锁车反馈状态：0：解锁；1：锁车中 2：已锁车）")
    private Short keyLockStatus;

    // 密钥（3字节）
    @TableField("key_lock")
    @Schema(description = "密钥（3字节）")
    private String keyLock;
}

